package lab02.test04;

class Employee {//定义一个员工的类
    private String name;
    private int number;
    private double salary;
    private double risesalary;//定义成员变量

    public Employee(String name, int number,
                    double salary, double risesalary) {
        this.name = name;
        this.number = number;
        this.salary = salary;
        this.risesalary = risesalary;//封装的数据
    }

    //用set,get取得数据


    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public int getNumber() {
        return number;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setRisesalary(double risesalary) {
        this.risesalary = risesalary;
    }

    public double getRisesalary() {
        return risesalary;
    }

    //单独写薪水增长额的算法
    public double percent() {
        return risesalary / salary * 100;
    }

    //单独写增长后的工资总额
    public double total() {
        return salary = salary + salary * percent() / 100;
    }
}
